// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   PagerTagExtraInfo.java

package com.jsptags.navigation.pager;

import com.jsptags.navigation.pager.parser.PagerTagExport;
import com.jsptags.navigation.pager.parser.ParseException;
import com.jsptags.navigation.pager.parser.TagExportParser;
import javax.servlet.jsp.tagext.*;

public final class PagerTagExtraInfo extends TagExtraInfo {

	static Class<Integer> clazz; /* synthetic field */

	public final VariableInfo[] getVariableInfo(TagData tagdata) {
		try {
			String s;
			s = tagdata.getAttributeString("export");
			if (s == null)
				return null;
			VariableInfo avariableinfo[];
			PagerTagExport pagertagexport = TagExportParser
					.parsePagerTagExport(s);
			int i = 0;
			if (pagertagexport.getPageOffset() != null)
				i++;
			if (pagertagexport.getPageNumber() != null)
				i++;
			avariableinfo = new VariableInfo[i];
			int j = 0;
			String s1;
			if ((s1 = pagertagexport.getPageOffset()) != null)
				avariableinfo[j++] = new VariableInfo(s1,
						(clazz == null
								&& (clazz = class$("[Ljava.lang.Integer;",
										false)) == null ? clazz : clazz)
								.getName(), true, 0);
			if ((s1 = pagertagexport.getPageNumber()) != null)
				avariableinfo[j++] = new VariableInfo(s1,
						(clazz == null
								&& (clazz = class$("[Ljava.lang.Integer;",
										false)) == null ? clazz : clazz)
								.getName(), true, 0);
			return avariableinfo;
		} catch (ParseException e) {
			return new VariableInfo[0];
		}
	}

	public final boolean isValid(TagData tagdata) {
		String s = tagdata.getAttributeString("export");
		if (s != null)
			try {
				TagExportParser.parsePagerTagExport(s);
			} catch (ParseException parseexception) {
				return false;
			}
		return true;
	}

	@SuppressWarnings("unchecked")
	static Class class$(String s, boolean flag) {
		try {
			Class claz = Class.forName(s);
			if (flag) {
				return null;
			} else {
				return claz;
			}
		} catch (ClassNotFoundException e) {
			throw new NoClassDefFoundError(e.getMessage());
		}
	}

	public PagerTagExtraInfo() {
	}
}
